# Build script for v8host sample project...

ARCH="-arch i386"

INC_PATHS="-I./ -I../"
V8_INC_PATH="-I../../libv8/include"
V8_LIB_PATH="../../libv8/libv8_g.a"

PREP_DEFS="-D DEBUG=1 -D _DEBUG=1"
GCC_OPTS="-c"

# clean...
rm -f *.o
rm -f v8host

# start build...
echo "Building v8host"

gcc $ARCH $PREP_DEFS $GCC_OPTS ../v8class.cpp $INC_PATHS $V8_INC_PATH

gcc $ARCH $PREP_DEFS $GCC_OPTS point.cpp $INC_PATHS $V8_INC_PATH
gcc $ARCH $PREP_DEFS $GCC_OPTS global.cpp $INC_PATHS $V8_INC_PATH
gcc $ARCH $PREP_DEFS $GCC_OPTS embedded_js.c
gcc $ARCH $PREP_DEFS $GCC_OPTS v8host.cpp $INC_PATHS $V8_INC_PATH

g++ $ARCH v8host.o point.o global.o embedded_js.o v8class.o $V8_LIB_PATH -o v8host

# clean...
echo "Cleaning..."
rm -f *.o

echo "Build complete..."
